2 Problem: 10446 - The Marriage Interview :-)
4 Author: Andrés Mejía-Posada
6 Method: Top down dynamic programming with memoization.
14 unsigned long long memo
[62][62];
16 unsigned long long trib(int n
, int back
){
18 if (memo
[n
][back
] == -1){
19 memo
[n
][back
] = 1; //Esta invocación
20 for(int i
=1; i
<=back
; i
++){
21 memo
[n
][back
] += trib(n
-i
, back
);
29 memset(memo
, -1, sizeof memo
);
30 while (cin
>> n
>> back
&& n
<= 60){
31 cout
<< "Case " << C
++ << ": " << trib(n
, back
) << endl
;